import request from '@/utils/request'

export const register = function (data) {
  return request.post('/user/registered', data)
}
export const login = function (data) {
  return request.post('/user/login', data)
}
export const getHome = function () {
  return request.get('/home/swiper')
}
export const getCity = function (level) {
  return request.get('/area/city', {
    params: {
      level
    }
  })
}
export const getHomeList = function (params) {
  return request.get('/houses', { params })
}
export const getHomeinfo = function (id) {
  return request.get('/houses/' + id)
}
export const getUser = function (params) {
  return request.get('/user', { params })
}
export const getCollect = id => {
  return request.post('/user/favorites/' + id)
}
